/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simulateurs.controllers;
import java.io.*;
import sun.audio.*;
/**
 *
 * @author Alexandre
 */
public class SoundPlayer {
 
    String nom;     //nom du fichier
    
    
    public SoundPlayer(String nom){             //constructeur
    this.nom=nom;
    }
    
    
    public void playSound(){            //méthode de lecture

try{
AudioPlayer p = AudioPlayer.player;

AudioStream as = new AudioStream(new FileInputStream(nom));

p.start(as);

}

catch(IOException IOE){}

}
}
